package com.loan.common;

import java.math.BigInteger;
import java.security.MessageDigest;



public class Encode {
    private static final String KEY_MD = "MD";
    public static String getResult(String inputStr)
    {
        System.out.println("=======加密前的数据:"+inputStr);
        BigInteger bigInteger=null;
        try {
            MessageDigest md = MessageDigest.getInstance(KEY_MD);
            byte[] inputData = inputStr.getBytes();
            md.update(inputData);
            bigInteger = new BigInteger(md.digest());
        } catch (Exception e) {e.printStackTrace();}
        System.out.println("MD加密后:" + bigInteger.toString());
        return bigInteger.toString();
    }
    public static void main(String args[])
    {
        try {
            String inputStr = "13307931211";
            getResult(inputStr);
          // System.out.print();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
